package com.example.lambda.practice;

import com.example.lambda.test.Employer;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class practice {

    List<Employer> lists = Arrays.asList(
            new Employer("张三",18,99999,Employer.Status.Busy),
            new Employer("李四",20,44444,Employer.Status.Free),
            new Employer("王五",50,55555,Employer.Status.Vacation),
            new Employer("赵六",38,66666,Employer.Status.Free),
            new Employer("田七",28,77777,Employer.Status.Vacation)

    );

    @Test
    public void test(){
        Integer []nums = new Integer[]{1,2,3,4,5};
        Arrays.stream(nums)
                .map(x->x*x)
                .forEach(System.out::println);
    }

    @Test
    public void test2(){
        System.out.println(lists.stream()
                .collect(Collectors.counting()));
    }
}
